<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="com.pptree.service.*" %>
<%@ page import="com.pptree.service.impl.*" %>
<%@ page import="com.pptree.vo.*" %>



<%
	request.setCharacterEncoding("UTF-8");
    int id = Integer.valueOf(request.getParameter("gid"));
	String name = request.getParameter("name");
	
	Genre g = new Genre();
	g.setId(id);
	g.setName(name);
	
	GenreService genreService = new GenreServiceImpl();
	boolean result = genreService.modifyCategory(g);
	if(result){
		String js = "<script>alert('修改新闻分类成功！');location.href='genreList.jsp'</script>";
		out.print(js);
	}
	else{
		String js = "<script>alert('修改新闻分类失败！\\n此新闻分类己存在！。');location.href='genreList.jsp'</script>";
		out.print(js);
	}
	
%>